Windows Phone 8 Recipes: A Problem-Solution Approach by Lori Lalonde & David R. Totzke

Windows Phone 8 Recipes: A Problem-Solution Approach by Lori Lalonde & David R. Totzke

Author:Lori Lalonde & David R. Totzke [Lalonde, Lori & Totzke, David R.]
Language: eng
Format: epub
Tags: Computers, Programming Languages, C#, Programming, Microsoft
ISBN: 9781430259022
Publisher: Apress
Published: 2013-09-11T04:00:00+00:00


Listing 7-11. Overriding the OnNavigatedTo Event in the PhoneDetailsPage Code-Behind

protected override void OnNavigatedTo(NavigationEventArgs e)

{

if (NavigationContext.QueryString.ContainsKey("pic"))

{

string imageName = NavigationContext.QueryString["pic"];

using (MediaLibrary myLibrary = new MediaLibrary())

{

Picture myPic = myLibrary.SavedPictures.Where(p => p.Name == imageName).FirstOrDefault();

if (myPic != null)

{

BitmapImage bmp = new BitmapImage();

bmp.SetSource(myPic.GetImage());

myImage.Source = bmp;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.